package org.docx4j.fonts;

import org.docx4j.fonts.fop.fonts.EmbedFontInfo;
import org.docx4j.fonts.fop.fonts.Typeface;

import java.net.URI;

/**
 * 添加一个假的字体，于吉宽尝试添加一个web字体
 * @author yujikuan
 *
 */
public class FontFactory {
    public static PhysicalFont createWebFont(String fontName) {
        return new PhysicalFont(fontName, null, null) {
            private String name = fontName;

            @Override
            public Typeface getTypeface() {
                return null; // 不加载实际字体
            }

            @Override
            public String getName() {
                return name;
            }

            @Override
            public EmbedFontInfo getEmbedFontInfo() {
                return null;
            }

            @Override
            public URI getEmbeddedURI() {
                return null;
            }
        };
    }
}
